var GameAudio = {
  playSurpriseAudio: function(surprise) {
    $('#surprise-audio').attr('src', 'audios/' + surprise + '.mp3');
    $('#surprise-audio').get().play();
  },

  /**
   * Play audio when game going on or waiting player login.
   * @param {String} type gaming or waiting
   */
  playBackgroundAudio: function(type) {
    var $bgAudio = $('#bg-audio');
    var bgAudio = $bgAudio.get();
    $bgAudio.attr({
      src: 'audios/' + type + '.mp3',
      loop: 'loop'
    });
    if (type == 'gaming') {
      bgAudio.volume = 0.6;
    } else {
      bgAudio.volume = 1;
    }
    bgAudio.play();
  }
};